package com.hwn.datax.utils;

import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.stage.Modality;
import javafx.stage.Stage;

import java.io.IOException;
import java.util.Objects;

/**
 * @author wnhuang
 * @date 2024/6/3 12:00
 */
public class AlertUtil {

    public static void showAlert(String title, String content, Alert.AlertType type) {
        Alert alert = new Alert(type);
        alert.setTitle(title);
        alert.setHeaderText(null);
        alert.setContentText(content);
        alert.showAndWait();
    }

    public static void showAlert(String title, String content) {
        showAlert(title, content, Alert.AlertType.INFORMATION);
    }

    public static void showAlert(String content) {
        showAlert("提示", content, Alert.AlertType.INFORMATION);
    }

    public static void showSuccessAlert(String content) {
        showAlert("提示", content, Alert.AlertType.INFORMATION);
    }

    public static void showErrorAlert(String content) {
        showAlert("错误", content, Alert.AlertType.ERROR);
    }


    public static void showWarningAlert(String content) {
        showAlert("警告", content, Alert.AlertType.WARNING);
    }


}
